package 终极案例;

import java.util.Scanner;

public class test04 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int[] arr = new int[6];

        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入成绩：");
            int a = sc.nextInt();
            arr[i] = a;
        }

        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length -1) {
                System.out.print(arr[i]);
            } else {
                System.out.print(arr[i] + ",");
            }
        }
        System.out.println("]");

        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }


        for (int i = 0; i < arr.length; i++) {
            if (arr[0] > arr[i]) {
                 arr[0] = arr[i];
            }
        }

       double avg = 1.0F*(sum - arr[0]) / (arr.length - 1);
        System.out.println("平均成绩为：" + avg);

    }
}